// 1. express 框架
const express = require("express");

// 2.创建一个后台路由
const router = express.Router();
// 导入goods数据模块
const detailModel = require("../../model/detailModel");

router.get("/goodsdetail", async (req, res) => {
    let { gid } = req.query;
    await detailModel
        .get_goods_detail(gid)
        .then((content) => {
            res.send({
                code: 200,
                content,
            });
        })
        .catch((error) => {
            res.send({
                code: 200,
                error,
            });
        });
});

module.exports = router;
